//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class FillOverlayEffect : Effect
    {
        private BlendMode blend;
        private FillProperties fillProperties;

        public FillProperties FillProperties
        {
            get { return fillProperties; }
            set { fillProperties = value; }
        }

        public BlendMode Blend
        {
            get { return blend; }
            set { blend = value; }
        }


        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("fillOverlay"))
            {
                Blend = c.GetEnum<BlendMode>("blend");
                FillProperties = FillProperties.ReadFillProperties(c);
            }
        }


        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("fillOverlay"))
            {
                c.SetEnum("blend", Blend);
                c.WriteElement(FillProperties);
            }
        }
    }
}